1. The length of the string, for example:
* $ Var = "Get the length of me"
$ Echo $ {# var}
20
* $ Expr length "$ Var" # note that double quotation marks are used.
20
* $ Echo $ var | awk
Shell string operation
1. The length of the string, for example:
* $ Var = "get the length of me"
$ Echo $ {# var}
20
* $ Expr length "$ var" # note that double quotation marks are used.
20
Recently summed up some of the shell's operations on strings, hoping to help you better understand the shell. Strings can also be manipulated in the shell through external commands such as awk, SED, but invoking these external commands is very
Reprinted from: http://www.jb51.net/article/60326.htmWhat I want to say here is a few shell parentheses, braces and parentheses, the use of commands, as follows:1.${var}2.$ (CMD)3. () and
The role of various parentheses in the shell (), (()), [], [[]], {}Original: http://www.jb51.net/article/60326.htmhttp://blog.csdn.net/good_habits/article/details/27708745.http://blog.csdn.net/taiyang1987912/article/details/39551385What I want to
What I want to say here is the parentheses in several shells, the braces and the bracketed variables, and the use of the command, as follows:
1.${var}2.$ (CMD)3. () and {}4.${var:-string},${var:+string},${var:=string},${var:?string}5.$ ((exp))6.$
What I want to say here is a few shell parentheses, braces and parentheses, the use of commands, as follows:1.${var}2.$ (CMD)3. () and {}4.${var:-string},${var:+string},${var:=string},${var:?string}5.$ ((exp))6.$ (Var%pattern), $ (Var%%pattern), $
What I want to say here is a few shell parentheses, braces and parentheses, the use of commands, as follows:1.${var}2.$ (CMD)3. () and {}4.${var:-string},${var:+string},${var:=string},${var:?string}5.$ ((exp))6.$ (Var%pattern), $ (Var%%pattern), $
Here I want to talk about the parentheses, braces, and variables in several shells. The command usage is as follows:
1. $ {var}2. $ (CMD)3. () and {}4. $ {var:-string}, $ {var: + string}, $ {var: = string}, $ {var :? String}5. $ (exp ))6. $ (VAR %
Today we summarize the basic concepts of bash color, configuration files, variables, arrays and related shell scripting.One. Bash's color display rulesYes, it's a color display, which is the ASCLL code for the color of the call settings, but in the
1 execution of a sequence of commands[Email protected] log]# (A=2;echo $a)2[email protected] log]# {A=2;echo $a;} #注意格式的不同, with a space on the left and a semicolon ending at the far right2The redirection of a command within 2 () and {} Brackets
The braces and parentheses in shell I want to talk about here are several types of shell parentheses, the structure of braces and the variables in parentheses. The Command usage is as follows: www.2cto. com1. $ {var} 2. $ (cmd) 3. () and {} 4. $
I couldn't remember the title of the brackets in shell, so I got such a Inappropriate title.
Here I want to talk about the parentheses, braces, and variables in several shells. The Command usage is as follows:
PHP code:
1. $
2. $ (cmd)
3. () and {}
4
String handling of Shell programmingIn the shell, because it is a weakly typed language, all variables are strings without declaring the variable type beforehand. So the processing of strings is very important.The following are common operations on
The first four methods are to remove some characters, and the last four methods to preserve certain characters1, # Intercept, delete the left character, retain the right charactervar= "Hello World"Echo ${var#*l}Results:Lo Worldwhere Var is the
One, parenthesis, round brackets () 1, single parenthesis () ① command group. The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses cannot be used by the rest of the script. Multiple commands in
2.Include Command
The include command can insert text or images from other documents into the currently parsed document, which is the key to the entire SSI. With the include command, you can update an entire site in just one file.
The include
Functions (), (), [], [], and {} of various parentheses in shellI. Parentheses ()1. Single parentheses ()
①Command Group. The commands in parentheses will open a new sub-shell for sequential execution, so the variables in parentheses cannot be used
2. the Include command can insert text or images from other documents into the currently parsed documents, which is the key to the whole SSI. By using the Include command, you only need to change one file to instantly update the entire site! The
One, parenthesis, round brackets () 1, single parenthesis () ① command group. The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses cannot be used by the rest of the script. Multiple commands in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.